#pragma once

#include <dinput.h>

class Input
{
	IDirectInput8*       mDirectInput;

	IDirectInputDevice8* mKeyboard;
	byte                 mKeyboardState[256]; 
	byte				 mPrevKeyboardState[256];

	IDirectInputDevice8* mMouse;
	DIMOUSESTATE2        mMouseState;
	DIMOUSESTATE2		 mPrevMouseState;

	// Make private to prevent copying of members of this class.
	Input(const DirectInput& rhs);
	Input& operator=(const DirectInput& rhs);

public:
	Input(DWORD keyboardCoopFlags, DWORD mouseCoopFlags);
	~Input();

	void update();
	bool keyDown(char key);
	bool keyPressed(char key);
	bool mouseButtonDown(int button);
	bool mousePressed(int button);

	float mouseDX();
	float mouseDY();
	float mouseDZ();

};
extern DirectInput* gDInput;